import { IPSCodeList } from '../../codelist/ipscode-list';
import { IPSDEDBTable } from '../../database/ipsdedbtable';
import { IPSDEFDTColumn } from '../../database/ipsdefdtcolumn';
import { IPSSysDBColumn } from '../../database/ipssys-dbcolumn';
import { IPSDataEntity } from '../ipsdata-entity';
import { IPSDataEntityObject } from '../ipsdata-entity-object';
import { IPSDEFSearchMode } from './ipsdefsearch-mode';
import { IPSDEFUIMode } from './ipsdefuimode';
import { IPSDEField } from './ipsdefield';
import { IPSDEFValueRule } from './valuerule/ipsdefvalue-rule';
import { IPSDEFLogic } from '../logic/ipsdeflogic';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { IPSSysSequence } from '../../res/ipssys-sequence';
import { IPSSysTranslator } from '../../res/ipssys-translator';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEFieldImpl extends PSModelObjectImpl implements IPSDEField, IPSDataEntityObject {
  protected allpsdefdtcolumns: IPSDEFDTColumn[] | null = null;

  getAllPSDEFDTColumns(): IPSDEFDTColumn[] | null {
    if (this.allpsdefdtcolumns == null) {
      this.allpsdefdtcolumns = this.fillChildListModel(this.M.getAllPSDEFDTColumns, 'database.IPSDEFDTColumn') as IPSDEFDTColumn[];
    }
    return this.allpsdefdtcolumns;
  }

  get allPSDEFDTColumns(): IPSDEFDTColumn[] | null {
    return this.getAllPSDEFDTColumns();
  }

  findPSDEFDTColumn(objKey: any): IPSDEFDTColumn | null {
    return this.getPSModel5('database.IPSDEFDTColumn', this.getAllPSDEFDTColumns(), objKey) as IPSDEFDTColumn;
  }

  protected allpsdefsearchmodes: IPSDEFSearchMode[] | null = null;

  getAllPSDEFSearchModes(): IPSDEFSearchMode[] | null {
    if (this.allpsdefsearchmodes == null) {
      this.allpsdefsearchmodes = this.fillChildListModel(this.M.getAllPSDEFSearchModes, 'dataentity.defield.IPSDEFSearchMode') as IPSDEFSearchMode[];
    }
    return this.allpsdefsearchmodes;
  }

  get allPSDEFSearchModes(): IPSDEFSearchMode[] | null {
    return this.getAllPSDEFSearchModes();
  }

  findPSDEFSearchMode(objKey: any): IPSDEFSearchMode | null {
    return this.getPSModel5('dataentity.defield.IPSDEFSearchMode', this.getAllPSDEFSearchModes(), objKey) as IPSDEFSearchMode;
  }

  protected allpsdefuimodes: IPSDEFUIMode[] | null = null;

  getAllPSDEFUIModes(): IPSDEFUIMode[] | null {
    if (this.allpsdefuimodes == null) {
      this.allpsdefuimodes = this.fillChildListModel(this.M.getAllPSDEFUIModes, 'dataentity.defield.IPSDEFUIMode') as IPSDEFUIMode[];
    }
    return this.allpsdefuimodes;
  }

  get allPSDEFUIModes(): IPSDEFUIMode[] | null {
    return this.getAllPSDEFUIModes();
  }

  findPSDEFUIMode(objKey: any): IPSDEFUIMode | null {
    return this.getPSModel5('dataentity.defield.IPSDEFUIMode', this.getAllPSDEFUIModes(), objKey) as IPSDEFUIMode;
  }

  protected allpsdefvaluerules: IPSDEFValueRule[] | null = null;

  getAllPSDEFValueRules(): IPSDEFValueRule[] | null {
    if (this.allpsdefvaluerules == null) {
      this.allpsdefvaluerules = this.fillChildListModel(this.M.getAllPSDEFValueRules, 'dataentity.defield.valuerule.IPSDEFValueRule') as IPSDEFValueRule[];
    }
    return this.allpsdefvaluerules;
  }

  get allPSDEFValueRules(): IPSDEFValueRule[] | null {
    return this.getAllPSDEFValueRules();
  }

  findPSDEFValueRule(objKey: any): IPSDEFValueRule | null {
    return this.getPSModel5('dataentity.defield.valuerule.IPSDEFValueRule', this.getAllPSDEFValueRules(), objKey) as IPSDEFValueRule;
  }

  get auditInfoFormat(): string {
    return this.M.auditInfoFormat;
  }

  get bizTag():
    | 'WFINSTANCEID'
    | 'WFSTEP'
    | 'WFUSERSTATE'
    | 'WFVERSION'
    | 'WFSTATE'
    | 'BEGINTIME'
    | 'ENDTIME'
    | 'DURATION'
    | 'USER'
    | 'USER2'
    | 'USER3'
    | 'USER4'
    | 'USER5'
    | 'USER6'
    | 'USER7'
    | 'USER8'
    | 'USER9' {
    return this.M.bizTag;
  }

  protected checkpsdeflogic: IPSDEFLogic | null = null;

  getCheckPSDEFLogic(): IPSDEFLogic | null {
    if (this.checkpsdeflogic != null) return this.checkpsdeflogic;
    const value = this.M.getCheckPSDEFLogic;
    if (value == null) {
      return null;
    }
    const ipsdataentity = this.getParentPSModelObject('dataentity.IPSDataEntity') as IPSDataEntity;
    if (ipsdataentity != null) {
      this.checkpsdeflogic = ipsdataentity.findPSDELogic(value) as IPSDEFLogic;
    }
    return this.checkpsdeflogic;
  }

  get checkPSDEFLogic(): IPSDEFLogic | null {
    return this.getCheckPSDEFLogic();
  }

  getCheckPSDEFLogicMust(): IPSDEFLogic {
    const value = this.getCheckPSDEFLogic();
    if (value == null) {
      throw new Error('未指定值检查逻辑');
    }
    return value;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get computeExpression(): string {
    return this.M.computeExpression;
  }

  protected computepsdeflogic: IPSDEFLogic | null = null;

  getComputePSDEFLogic(): IPSDEFLogic | null {
    if (this.computepsdeflogic != null) return this.computepsdeflogic;
    const value = this.M.getComputePSDEFLogic;
    if (value == null) {
      return null;
    }
    const ipsdataentity = this.getParentPSModelObject('dataentity.IPSDataEntity') as IPSDataEntity;
    if (ipsdataentity != null) {
      this.computepsdeflogic = ipsdataentity.findPSDELogic(value) as IPSDEFLogic;
    }
    return this.computepsdeflogic;
  }

  get computePSDEFLogic(): IPSDEFLogic | null {
    return this.getComputePSDEFLogic();
  }

  getComputePSDEFLogicMust(): IPSDEFLogic {
    const value = this.getComputePSDEFLogic();
    if (value == null) {
      throw new Error('未指定值计算逻辑');
    }
    return value;
  }

  get dBValueInsertMode(): 'IGNORE' | 'VERSION' | 'CURDATETIME' | 'CURDATE' | 'VALUEFUNC' {
    return this.M.dBValueInsertMode;
  }

  get dBValueUpdateMode(): 'IGNORE' | 'VERSION' | 'CURDATETIME' | 'CURDATE' | 'VALUEFUNC' {
    return this.M.dBValueUpdateMode;
  }

  get dEFType(): 1 | 2 | 3 | 4 | 5 {
    return this.M.dEFType;
  }

  get dEMSFieldMode(): 'STATE1' | 'STATE2' | 'STATE3' {
    return this.M.dEMSFieldMode;
  }

  get dataType():
    | 'ACID'
    | 'BIGINT'
    | 'CODELISTTEXT'
    | 'CURRENCY'
    | 'CURRENCYUNIT'
    | 'DATE'
    | 'DATETIME'
    | 'DATETIME_BIRTHDAY'
    | 'DECIMAL'
    | 'BIGDECIMAL'
    | 'FLOAT'
    | 'GUID'
    | 'HTMLTEXT'
    | 'INHERIT'
    | 'INT'
    | 'LONGTEXT'
    | 'LONGTEXT_1000'
    | 'NBID'
    | 'NMCODELIST'
    | 'NSCODELIST'
    | 'PICKUP'
    | 'PICKUPDATA'
    | 'PICKUPTEXT'
    | 'SBID'
    | 'SMCODELIST'
    | 'SSCODELIST'
    | 'TEXT'
    | 'TEXT_EMAIL'
    | 'TIME'
    | 'TRUEFALSE'
    | 'VARBINARY'
    | 'WFSTATE'
    | 'YESNO'
    | 'ONE2MANYDATA'
    | 'ONE2MANYDATA_MAP'
    | 'PICKUPOBJECT'
    | 'ONE2ONEDATA'
    | 'FILE'
    | 'ONE2MANYOBJ'
    | 'ONE2MANYOBJ_MAP'
    | 'ONE2ONEOBJ'
    | 'FILELIST'
    | 'LONGFILELIST'
    | 'PICTURE'
    | 'PICTURELIST'
    | 'LONGPICTURELIST'
    | 'TEXTARRAY'
    | 'TEXTARRAY2'
    | 'INTARRAY'
    | 'INTARRAY2'
    | 'BIGINTARRAY'
    | 'BIGINTARRAY2'
    | 'FLOATARRAY'
    | 'FLOATARRAY2'
    | 'DECIMALARRAY'
    | 'DECIMALARRAY2' {
    return this.M.dataType;
  }

  protected defaultpsdefsearchmode: IPSDEFSearchMode | null = null;

  getDefaultPSDEFSearchMode(): IPSDEFSearchMode | null {
    if (this.defaultpsdefsearchmode != null) return this.defaultpsdefsearchmode;
    const value = this.M.getDefaultPSDEFSearchMode;
    if (value == null) {
      return null;
    }
    this.defaultpsdefsearchmode = this.findPSDEFSearchMode(value);
    return this.defaultpsdefsearchmode;
  }

  get defaultPSDEFSearchMode(): IPSDEFSearchMode | null {
    return this.getDefaultPSDEFSearchMode();
  }

  getDefaultPSDEFSearchModeMust(): IPSDEFSearchMode {
    const value = this.getDefaultPSDEFSearchMode();
    if (value == null) {
      throw new Error('未指定默认属性搜索模式');
    }
    return value;
  }

  get defaultValue(): string {
    return this.M.defaultValue;
  }

  protected defaultvaluepsdeflogic: IPSDEFLogic | null = null;

  getDefaultValuePSDEFLogic(): IPSDEFLogic | null {
    if (this.defaultvaluepsdeflogic != null) return this.defaultvaluepsdeflogic;
    const value = this.M.getDefaultValuePSDEFLogic;
    if (value == null) {
      return null;
    }
    const ipsdataentity = this.getParentPSModelObject('dataentity.IPSDataEntity') as IPSDataEntity;
    if (ipsdataentity != null) {
      this.defaultvaluepsdeflogic = ipsdataentity.findPSDELogic(value) as IPSDEFLogic;
    }
    return this.defaultvaluepsdeflogic;
  }

  get defaultValuePSDEFLogic(): IPSDEFLogic | null {
    return this.getDefaultValuePSDEFLogic();
  }

  getDefaultValuePSDEFLogicMust(): IPSDEFLogic {
    const value = this.getDefaultValuePSDEFLogic();
    if (value == null) {
      throw new Error('未指定默认值逻辑');
    }
    return value;
  }

  get defaultValueType(): 'SESSION' | 'APPLICATION' | 'UNIQUEID' | 'CONTEXT' | 'PARAM' | 'OPERATOR' | 'OPERATORNAME' | 'CURTIME' | 'APPDATA' | 'EXPRESSION' | 'USER' | 'USER2' | 'USER3' | 'USER4' {
    return this.M.defaultValueType;
  }

  get dupCheckMode(): 'NONE' | 'ALL' | 'NOTNULL' | 'CHECKVALUES' | 'EXCLUDEVALUES' {
    return this.M.dupCheckMode || 'NONE';
  }

  protected dupcheckpsdefields: IPSDEField[] | null = null;

  getDupCheckPSDEFields(): IPSDEField[] | null {
    if (this.dupcheckpsdefields == null) {
      const value = this.M.getDupCheckPSDEFields;
      if (value == null) {
        return null;
      }
      const arrayNode: any[] = value;
      if (arrayNode.length == 0) {
        return null;
      }
      const list: IPSDEField[] = [];
      const ipsdataentity = this.getParentPSModelObject('dataentity.IPSDataEntity') as IPSDataEntity;
      for (let i = 0; i < arrayNode.length; i++) {
        const item = ipsdataentity.findPSDEField(arrayNode[i]);
        if (item != null) {
          list.push(item);
        }
      }
      this.dupcheckpsdefields = list;
    }
    return this.dupcheckpsdefields.length == 0 ? null : this.dupcheckpsdefields;
  }

  get dupCheckPSDEFields(): IPSDEField[] | null {
    return this.getDupCheckPSDEFields();
  }

  findDupCheckPSDEField(objKey: any): IPSDEField | null {
    return this.getPSModel5('dataentity.defield.IPSDEField', this.getDupCheckPSDEFields(), objKey) as IPSDEField;
  }

  protected dupcheckvalues: string[] | null = null;

  getDupCheckValues(): string[] | null {
    if (this.dupcheckvalues == null) {
      const value = this.M.dupCheckValues;
      if (value == null) {
        return null;
      }
      const arrayNode: any[] = value;
      if (arrayNode.length == 0) {
        return null;
      }
      const list: string[] = [];
      for (let i = 0; i < arrayNode.length; i++) {
        list.push(arrayNode[i]);
      }
      this.dupcheckvalues = list;
    }
    return this.dupcheckvalues;
  }

  get dupCheckValues(): string[] | null {
    return this.getDupCheckValues();
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  get extendMode(): 0 | 2 {
    return this.M.extendMode != null ? this.M.extendMode : 0;
  }

  get importOrder(): number {
    return this.M.importOrder;
  }

  get importTag(): string {
    return this.M.importTag;
  }

  protected lnpslanguageres: IPSLanguageRes | null = null;

  getLNPSLanguageRes(): IPSLanguageRes | null {
    if (this.lnpslanguageres != null) return this.lnpslanguageres;
    const value = this.M.getLNPSLanguageRes;
    if (value == null) {
      return null;
    }
    this.lnpslanguageres = this.getPSModel4('res.IPSLanguageRes', value, 'getLNPSLanguageRes') as IPSLanguageRes;
    return this.lnpslanguageres;
  }

  get lNPSLanguageRes(): IPSLanguageRes | null {
    return this.getLNPSLanguageRes();
  }

  getLNPSLanguageResMust(): IPSLanguageRes {
    const value = this.getLNPSLanguageRes();
    if (value == null) {
      throw new Error('未指定逻辑名称语言资源');
    }
    return value;
  }

  get length(): number {
    return this.M.length != null ? this.M.length : 0;
  }

  get logicName(): string {
    return this.M.logicName;
  }

  get maxValueString(): string {
    return this.M.maxValueString;
  }

  get memo(): string {
    return this.M.memo;
  }

  get minStringLength(): number {
    return this.M.minStringLength != null ? this.M.minStringLength : 0;
  }

  get minValueString(): string {
    return this.M.minValueString;
  }

  get name(): string {
    return this.M.name;
  }

  get nullValueOrderMode(): 'FIRST' | 'LAST' {
    return this.M.nullValueOrderMode;
  }

  protected onchangepsdeflogic: IPSDEFLogic | null = null;

  getOnChangePSDEFLogic(): IPSDEFLogic | null {
    if (this.onchangepsdeflogic != null) return this.onchangepsdeflogic;
    const value = this.M.getOnChangePSDEFLogic;
    if (value == null) {
      return null;
    }
    const ipsdataentity = this.getParentPSModelObject('dataentity.IPSDataEntity') as IPSDataEntity;
    if (ipsdataentity != null) {
      this.onchangepsdeflogic = ipsdataentity.findPSDELogic(value) as IPSDEFLogic;
    }
    return this.onchangepsdeflogic;
  }

  get onChangePSDEFLogic(): IPSDEFLogic | null {
    return this.getOnChangePSDEFLogic();
  }

  getOnChangePSDEFLogicMust(): IPSDEFLogic {
    const value = this.getOnChangePSDEFLogic();
    if (value == null) {
      throw new Error('未指定值变更逻辑');
    }
    return value;
  }

  protected pscodelist: IPSCodeList | null = null;

  getPSCodeList(): IPSCodeList | null {
    if (this.pscodelist != null) return this.pscodelist;
    const value = this.M.getPSCodeList;
    if (value == null) {
      return null;
    }
    this.pscodelist = this.getPSModel4('codelist.IPSCodeList', value, 'getPSCodeList') as IPSCodeList;
    return this.pscodelist;
  }

  get psCodeList(): IPSCodeList | null {
    return this.getPSCodeList();
  }

  getPSCodeListMust(): IPSCodeList {
    const value = this.getPSCodeList();
    if (value == null) {
      throw new Error('未指定属性代码表');
    }
    return value;
  }

  protected psdedbtable: IPSDEDBTable | null = null;

  getPSDEDBTable(): IPSDEDBTable | null {
    if (this.psdedbtable != null) return this.psdedbtable;
    const value = this.M.getPSDEDBTable;
    if (value == null) {
      return null;
    }
    const ipsdataentity = this.getParentPSModelObject('dataentity.IPSDataEntity') as IPSDataEntity;
    if (ipsdataentity != null) {
      this.psdedbtable = ipsdataentity.findPSDEDBTable(value);
    }
    return this.psdedbtable;
  }

  get psDEDBTable(): IPSDEDBTable | null {
    return this.getPSDEDBTable();
  }

  getPSDEDBTableMust(): IPSDEDBTable {
    const value = this.getPSDEDBTable();
    if (value == null) {
      throw new Error('未指定实体数据表对象');
    }
    return value;
  }

  protected pssysdbcolumn: IPSSysDBColumn | null = null;

  getPSSysDBColumn(): IPSSysDBColumn | null {
    if (this.pssysdbcolumn != null) return this.pssysdbcolumn;
    const value = this.M.getPSSysDBColumn;
    if (value == null) {
      return null;
    }
    this.pssysdbcolumn = this.getPSDEDBTableMust().getPSSysDBTableMust().findPSSysDBColumn(value);
    return this.pssysdbcolumn;
  }

  get psSysDBColumn(): IPSSysDBColumn | null {
    return this.getPSSysDBColumn();
  }

  getPSSysDBColumnMust(): IPSSysDBColumn {
    const value = this.getPSSysDBColumn();
    if (value == null) {
      throw new Error('未指定关系数据库列对象');
    }
    return value;
  }

  protected pssyssequence: IPSSysSequence | null = null;

  getPSSysSequence(): IPSSysSequence | null {
    if (this.pssyssequence != null) return this.pssyssequence;
    const value = this.M.getPSSysSequence;
    if (value == null) {
      return null;
    }
    this.pssyssequence = this.getPSModel4('res.IPSSysSequence', value, 'getPSSysSequence') as IPSSysSequence;
    return this.pssyssequence;
  }

  get psSysSequence(): IPSSysSequence | null {
    return this.getPSSysSequence();
  }

  getPSSysSequenceMust(): IPSSysSequence {
    const value = this.getPSSysSequence();
    if (value == null) {
      throw new Error('未指定系统值序列');
    }
    return value;
  }

  protected pssystranslator: IPSSysTranslator | null = null;

  getPSSysTranslator(): IPSSysTranslator | null {
    if (this.pssystranslator != null) return this.pssystranslator;
    const value = this.M.getPSSysTranslator;
    if (value == null) {
      return null;
    }
    this.pssystranslator = this.getPSModel4('res.IPSSysTranslator', value, 'getPSSysTranslator') as IPSSysTranslator;
    return this.pssystranslator;
  }

  get psSysTranslator(): IPSSysTranslator | null {
    return this.getPSSysTranslator();
  }

  getPSSysTranslatorMust(): IPSSysTranslator {
    const value = this.getPSSysTranslator();
    if (value == null) {
      throw new Error('未指定系统值转换器');
    }
    return value;
  }

  get precision(): number {
    return this.M.precision != null ? this.M.precision : 0;
  }

  get predefinedType():
    | 'NONE'
    | 'LOGICVALID'
    | 'ORDERVALUE'
    | 'VERSION'
    | 'CREATEMAN'
    | 'CREATEMANNAME'
    | 'CREATEDATE'
    | 'UPDATEMAN'
    | 'UPDATEMANNAME'
    | 'UPDATEDATE'
    | 'ORGID'
    | 'ORGNAME'
    | 'ORGSECTORID'
    | 'ORGSECTORNAME'
    | 'PARENTTYPE'
    | 'PARENTID'
    | 'PARENTNAME'
    | 'PARENTIDPATH'
    | 'PARENTNAMEPATH'
    | 'TIMESTAMP'
    | 'DYNASTORAGE' {
    return this.M.predefinedType;
  }

  get queryOption(): 'LIKE' | '=' | 'LIKESPLIT' {
    return this.M.queryOption;
  }

  get sequenceMode(): 'NONE' | 'GETDRAFT' | 'CREATE' | 'USER' | 'USER2' | 'USER3' | 'USER4' {
    return this.M.sequenceMode || 'NONE';
  }

  get serviceCodeName(): string {
    return this.M.serviceCodeName;
  }

  get stdDataType(): 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 {
    return this.M.stdDataType;
  }

  get stringCase(): 'UCASE' | 'LCASE' | 'PASSWORD' | 'USER' | 'USER2' | 'USER3' | 'USER4' {
    return this.M.stringCase;
  }

  get stringLength(): number {
    return this.M.stringLength != null ? this.M.stringLength : 0;
  }

  get translatorMode(): 'NONE' | 'DIGEST' | 'ENCRYPT' | 'TRANSLATE' | 'TRANSLATE2' | 'UCASE' | 'LCASE' | 'USER' | 'USER2' | 'USER3' | 'USER4' {
    return this.M.translatorMode || 'NONE';
  }

  get unionKeyValue(): 'KEY1' | 'KEY2' | 'KEY3' | 'KEY4' | 'KEY5' | 'KEY6' | 'KEY7' | 'KEY8' {
    return this.M.unionKeyValue;
  }

  protected user2psdeflogic: IPSDEFLogic | null = null;

  getUser2PSDEFLogic(): IPSDEFLogic | null {
    if (this.user2psdeflogic != null) return this.user2psdeflogic;
    const value = this.M.getUser2PSDEFLogic;
    if (value == null) {
      return null;
    }
    const ipsdataentity = this.getParentPSModelObject('dataentity.IPSDataEntity') as IPSDataEntity;
    if (ipsdataentity != null) {
      this.user2psdeflogic = ipsdataentity.findPSDELogic(value) as IPSDEFLogic;
    }
    return this.user2psdeflogic;
  }

  get user2PSDEFLogic(): IPSDEFLogic | null {
    return this.getUser2PSDEFLogic();
  }

  getUser2PSDEFLogicMust(): IPSDEFLogic {
    const value = this.getUser2PSDEFLogic();
    if (value == null) {
      throw new Error('未指定用户自定义逻辑2');
    }
    return value;
  }

  protected user3psdeflogic: IPSDEFLogic | null = null;

  getUser3PSDEFLogic(): IPSDEFLogic | null {
    if (this.user3psdeflogic != null) return this.user3psdeflogic;
    const value = this.M.getUser3PSDEFLogic;
    if (value == null) {
      return null;
    }
    const ipsdataentity = this.getParentPSModelObject('dataentity.IPSDataEntity') as IPSDataEntity;
    if (ipsdataentity != null) {
      this.user3psdeflogic = ipsdataentity.findPSDELogic(value) as IPSDEFLogic;
    }
    return this.user3psdeflogic;
  }

  get user3PSDEFLogic(): IPSDEFLogic | null {
    return this.getUser3PSDEFLogic();
  }

  getUser3PSDEFLogicMust(): IPSDEFLogic {
    const value = this.getUser3PSDEFLogic();
    if (value == null) {
      throw new Error('未指定用户自定义逻辑3');
    }
    return value;
  }

  protected user4psdeflogic: IPSDEFLogic | null = null;

  getUser4PSDEFLogic(): IPSDEFLogic | null {
    if (this.user4psdeflogic != null) return this.user4psdeflogic;
    const value = this.M.getUser4PSDEFLogic;
    if (value == null) {
      return null;
    }
    const ipsdataentity = this.getParentPSModelObject('dataentity.IPSDataEntity') as IPSDataEntity;
    if (ipsdataentity != null) {
      this.user4psdeflogic = ipsdataentity.findPSDELogic(value) as IPSDEFLogic;
    }
    return this.user4psdeflogic;
  }

  get user4PSDEFLogic(): IPSDEFLogic | null {
    return this.getUser4PSDEFLogic();
  }

  getUser4PSDEFLogicMust(): IPSDEFLogic {
    const value = this.getUser4PSDEFLogic();
    if (value == null) {
      throw new Error('未指定用户自定义逻辑4');
    }
    return value;
  }

  get userCat(): string {
    return this.M.userCat;
  }

  protected userpsdeflogic: IPSDEFLogic | null = null;

  getUserPSDEFLogic(): IPSDEFLogic | null {
    if (this.userpsdeflogic != null) return this.userpsdeflogic;
    const value = this.M.getUserPSDEFLogic;
    if (value == null) {
      return null;
    }
    const ipsdataentity = this.getParentPSModelObject('dataentity.IPSDataEntity') as IPSDataEntity;
    if (ipsdataentity != null) {
      this.userpsdeflogic = ipsdataentity.findPSDELogic(value) as IPSDEFLogic;
    }
    return this.userpsdeflogic;
  }

  get userPSDEFLogic(): IPSDEFLogic | null {
    return this.getUserPSDEFLogic();
  }

  getUserPSDEFLogicMust(): IPSDEFLogic {
    const value = this.getUserPSDEFLogic();
    if (value == null) {
      throw new Error('未指定用户自定义逻辑');
    }
    return value;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get valueFormat(): string {
    return this.M.valueFormat;
  }

  protected valuepsdefield: IPSDEField | null = null;

  getValuePSDEField(): IPSDEField | null {
    if (this.valuepsdefield != null) return this.valuepsdefield;
    const value = this.M.getValuePSDEField;
    if (value == null) {
      return null;
    }
    const ipsdataentity = this.getParentPSModelObject('dataentity.IPSDataEntity') as IPSDataEntity;
    if (ipsdataentity != null) {
      this.valuepsdefield = ipsdataentity.findPSDEField(value);
    }
    return this.valuepsdefield;
  }

  get valuePSDEField(): IPSDEField | null {
    return this.getValuePSDEField();
  }

  getValuePSDEFieldMust(): IPSDEField {
    const value = this.getValuePSDEField();
    if (value == null) {
      throw new Error('未指定值项属性');
    }
    return value;
  }

  get viewLevel(): number {
    return this.M.viewLevel != null ? this.M.viewLevel : 1;
  }

  get allowEmpty(): boolean {
    return this.M.allowEmpty != null ? this.M.allowEmpty : true;
  }

  get checkRecursion(): boolean {
    return this.M.checkRecursion != null ? this.M.checkRecursion : false;
  }

  get dataTypeDEField(): boolean {
    return this.M.dataTypeDEField != null ? this.M.dataTypeDEField : false;
  }

  get dynaStorageDEField(): boolean {
    return this.M.dynaStorageDEField != null ? this.M.dynaStorageDEField : false;
  }

  get enableAudit(): boolean {
    return this.M.enableAudit != null ? this.M.enableAudit : false;
  }

  get enableCreate(): boolean {
    return this.M.enableCreate != null ? this.M.enableCreate : true;
  }

  get enableDBAutoValue(): boolean {
    return this.M.enableDBAutoValue != null ? this.M.enableDBAutoValue : false;
  }

  get enableModify(): boolean {
    return this.M.enableModify != null ? this.M.enableModify : true;
  }

  get enablePrivilege(): boolean {
    return this.M.enablePrivilege != null ? this.M.enablePrivilege : false;
  }

  get enableQuickSearch(): boolean {
    return this.M.enableQuickSearch != null ? this.M.enableQuickSearch : false;
  }

  get enableUICreate(): boolean {
    return this.M.enableUICreate != null ? this.M.enableUICreate : true;
  }

  get enableUIModify(): boolean {
    return this.M.enableUIModify != null ? this.M.enableUIModify : true;
  }

  get formulaDEField(): boolean {
    return this.M.formulaDEField;
  }

  get indexTypeDEField(): boolean {
    return this.M.indexTypeDEField != null ? this.M.indexTypeDEField : false;
  }

  get inheritDEField(): boolean {
    return this.M.inheritDEField;
  }

  get keyDEField(): boolean {
    return this.M.keyDEField != null ? this.M.keyDEField : false;
  }

  get keyNameDEField(): boolean {
    return this.M.keyNameDEField != null ? this.M.keyNameDEField : false;
  }

  get linkDEField(): boolean {
    return this.M.linkDEField != null ? this.M.linkDEField : false;
  }

  get majorDEField(): boolean {
    return this.M.majorDEField != null ? this.M.majorDEField : false;
  }

  get multiFormDEField(): boolean {
    return this.M.multiFormDEField != null ? this.M.multiFormDEField : false;
  }

  get pasteReset(): boolean {
    return this.M.pasteReset != null ? this.M.pasteReset : false;
  }

  get phisicalDEField(): boolean {
    return this.M.phisicalDEField != null ? this.M.phisicalDEField : true;
  }

  get queryColumn(): boolean {
    return this.M.queryColumn != null ? this.M.queryColumn : true;
  }

  get systemReserver(): boolean {
    return this.M.systemReserver != null ? this.M.systemReserver : false;
  }

  get uIAssistDEField(): boolean {
    return this.M.uIAssistDEField != null ? this.M.uIAssistDEField : false;
  }

  get uniTagField(): boolean {
    return this.M.uniTagField != null ? this.M.uniTagField : false;
  }

  get cls(): string {
    return 'PSDEFieldImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'dataentity.defield.IPSDEField') return true;
    return super.instanceof(cls);
  }
}
